package com.lianbang.pharmacy.adapter

import cn.ubest.mvvmcore.utils.ResourcesUtils
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.lianbang.pharmacy.R

/**
 * Created by maoqi on 2020/11/22.
 */
class SearchMedicineByCategoryListAdapter
    : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_search_medicine_by_category_list) {
    override fun convert(helper: BaseViewHolder, item: String) {
        val color = if (helper.layoutPosition % 2 == 1) {
            ResourcesUtils.getColor(R.color.colorPrimary)
        } else {
            ResourcesUtils.getColor(R.color.black)
        }
        helper.setBackgroundColor(R.id.iv_img, color)
    }

}